import java.util.regex.*;

public class Word {
	
	private String Val;

	public static boolean isWord( String var ) {
		var = var.trim();
		Pattern p = Pattern.compile( "[a-zA-Z]+" );
		Matcher m = p.matcher( var );
		return m.matches();
	}
	
	public Word( String Val ){
		if( Word.isWord( Val ) ) this.Val = Val;
	}
	
	public boolean equals( Object obj ){
		if( obj.getClass() != this.getClass() ) return false;

		Word p = (Word) obj; 
        return this.Val.equalsIgnoreCase(p.Val);
	}
	
	public String toString(){
		return this.Val;
	}
	
}
